package fei.yuzhi.com.loveflowers.ui.ProductActivity;

import android.util.Log;

import java.util.List;

import fei.yuzhi.com.loveflowers.bean.ProductBean;
import fei.yuzhi.com.loveflowers.utils.HttpUtils;

/**
 * Created by Administrator on 2016/10/9.
 */
public class ProductModle  implements ProductContract.ProductModle{


    @Override
    public void getProductBean(int page,String keyword, final loadProductBean mloadProductBean) {
        HttpUtils.getProductDara(page,keyword, new HttpUtils.onGetProduct() {
            @Override
            public void getNetProductList(List<ProductBean.DatasBean.GoodsListBean> list) {
                mloadProductBean.sendProductBean(list);
            }
        });
    }

    @Override
    public void getProductPrice(int page,String keyword, final loadProductPriceBean mloadProductPriceBean) {
        HttpUtils.getProductPriceDara(page,keyword, new HttpUtils.onGetProductPrice() {
            @Override
            public void getNetProductList(List<ProductBean.DatasBean.GoodsListBean> list) {
                mloadProductPriceBean.sendProductPriceBean(list);
            }
        });
    }

    @Override
    public void getProductSale(int page,String keyword, final loadProductSaleBean mloadProductSaleBean) {
        HttpUtils.getProductSaleDara(page,keyword, new HttpUtils.onGetProductSale() {
            @Override
            public void getNetProductList(List<ProductBean.DatasBean.GoodsListBean> list) {
                mloadProductSaleBean.sendProductSaleBean(list);
            }
        });
    }

    public interface loadProductBean{
       public void sendProductBean(List<ProductBean.DatasBean.GoodsListBean> list);
   }
    public interface loadProductPriceBean{
        public void sendProductPriceBean(List<ProductBean.DatasBean.GoodsListBean> list);
    }
    public interface loadProductSaleBean{
        public void sendProductSaleBean(List<ProductBean.DatasBean.GoodsListBean> list);
    }
}
